package com.joyintech.lianxi;

public class ChineseCharacterChecker {

    public static void main(String[] args) {
        String str = "Hello, 世界!";
        int chineseCharCount = 0;
        int length= 0;
        for (char c : str.toCharArray()) {
            if (Character.isIdeographic(c)) {
                chineseCharCount++;
            }
            length++;
        }

        int totle = chineseCharCount + length;
        System.out.println("数量: " + totle);
    }

}
